import React, {useEffect,useState} from 'react';
import { IRouteComponentProps } from 'umi'
import {useModel} from 'umi'
import styles from "./[id].less"
import {ArrowLeftOutlined} from '@ant-design/icons';

const CommentListPage: React.FC<IRouteComponentProps<{id:string}>> = (props) => {
  // let {commentLists} = useModel('topic');
  // let [lists,uselists]=useState([])

  useEffect(()=>{
    // commentLists({page: 1, size: 5});
  }, [])

let res=JSON.stringify(props.location.state)
console.log(res)


  async function backs() {
    history.go(-1)
   }
  return (
    <div className={styles.commentlist}>  
       <div className={styles.top}>
                <ArrowLeftOutlined className={styles.left} onClick={()=>{backs()}}/>
                <span>查看更多留言</span>
                <span></span>
        </div>
        {/* {
            res.map((item:string,index:number)=>{
              return <ul key={index} className={styles.items}>
                                <li >
                                    <span className={styles.cons}>{item.username}</span>
                                    <span>{item.add_time}</span>
                                </li>
                                <li >{item.content}</li>

                    </ul>
            })
        } */}
        {/* {
          <ul className={styles.items}>
                    <li>
                        <span className={styles.cons}>{res.username}</span>
                        <span>{res.add_time}</span>
                    </li>
                    <li>{res.content}</li>

          </ul>
        } */}
       {JSON.stringify(props.location.state)}
      
  
    </div>
  );
}


export default CommentListPage;
